package cn.aitrox.ry.service.auth.mapper;

import cn.aitrox.ry.service.auth.entity.AuthResourceEntity;
import cn.aitrox.ry.service.auth.entity.AuthUserRoleEntity;
import com.github.abel533.mapper.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AuthUserRoleMapper extends Mapper<AuthUserRoleEntity> {

    void batchInsert(@Param("list") List<AuthUserRoleEntity> list);

    void deleteByUserIdRoleIds(@Param("userId") Integer userId, @Param("roleIds") List<Integer> roleIds);

    void deleteByRoleIds(@Param("roleIds") List<Integer> roleIds);

    void deleteByUserIdsRoleIds(@Param("userIds") List<Integer> userIds, @Param("roleIds") List<Integer> roleIds);

    List<AuthUserRoleEntity> findByUserIds(@Param("userIds") List<Integer> userIds);

    List<AuthResourceEntity> findResoureByUserId(@Param("userId") Integer userId);
}
